home *** CD-ROM | disk | FTP | other *** search
- property pVideoName, pWhatChanges, pWhatShows, pDestination, pGroupName, pInitialState, pNumStates, pComplexString, ancestor
- global gCurrentVideo
-
- on beginSprite me
- set previousItemDelimiter to the itemDelimiter
- set the itemDelimiter to "."
- set pVideoName to item 1 of the name of the member of sprite the spriteNum of me
- set the itemDelimiter to previousItemDelimiter
- if pWhatShows = #gCurrentVideoStatus then
- if pInitialState = #on then
- set gCurrentVideo to pVideoName
- sendAllSprites(#UpdateDetail, #video)
- end if
- end if
- if pNumStates = #complex then
- set pNumStates to value(pComplexString)
- end if
- set numTrans to pNumStates
- if pWhatShows = #nothing then
- set togSty to 0
- else
- set togSty to 1
- end if
- set selfTog to pWhatChanges = pWhatShows
- set togGrup to pGroupName
- set togState to pInitialState
- set togOffbl to 0
- if pWhatChanges = #gCurrentVideoStatus then
- set togOnOthOff to 1
- else
- set togOnOthOff to 0
- end if
- set ancestor to new(script "Bitmap But 1", the spriteNum of me, numTrans, togSty, togGrup, togState, togOffbl, selfTog, togOnOthOff)
- end
-
- on MouseUpAction me
- if pWhatChanges = #gCurrentVideoStatus then
- set gCurrentVideo to pVideoName
- sendAllSprites(#UpdateDetail, #video)
- end if
- if pDestination <> EMPTY then
- go(pDestination)
- end if
- end
-
- on MouseDownAction me
- nothing()
- end
-
- on MouseEnterAction me
- nothing()
- end
-
- on MouseLeaveAction me
- nothing()
- end
-
- on getPropertyDescriptionList me
- set description to [:]
- addProp(description, #pInitialState, [#default: #off, #format: #symbol, #comment: "Initial State", #range: [#off, #on]])
- addProp(description, #pWhatChanges, [#default: #gCurrentVideoStatus, #format: #symbol, #comment: "What It Changes", #range: [#nothing, #gCurrentVideoStatus]])
- addProp(description, #pWhatShows, [#default: #gCurrentVideoStatus, #format: #symbol, #comment: "What It Shows", #range: [#nothing, #gCurrentVideoStatus]])
- addProp(description, #pGroupName, [#default: "VideoButtons", #format: #string, #comment: "Toggle Group Name"])
- addProp(description, #pDestination, [#default: EMPTY, #format: #string, #comment: "Frame Destination"])
- addProp(description, #pNumStates, [#default: 3, #format: #symbol, #comment: "Number of States", #range: [2, 3, 4, 5, 6, #complex]])
- addProp(description, #pComplexString, [#default: "[[1,0],[1,0],[1,0],[#m,0],[#m,0],[#m,0]]", #format: #string, #comment: "Complex State Description"])
- return description
- end
-
- on getBehaviorDescription me
- set endChar to offset("--END OF HEADER", the text of me)
- set endLine to the number of lines in char 1 to endChar of the text of me - 1
- set description to line 1 to endLine of the text of me
- repeat with whichLine = endLine down to 1
- if line whichLine of description = EMPTY then
- delete line whichLine of description
- end if
- end repeat
- delete line 1 of description
- return description
- end
-